-
-
Notifications
You must be signed in to change notification settings - Fork 435
feat: update to spec v1.7.0-alpha.2 [wip] #8881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unstable
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @nflaig, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request brings the codebase up-to-date with the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates the codebase to align with the v1.7.0-alpha.2 consensus spec. The changes are extensive, touching configuration, state transition logic, caching, and type definitions. The refactoring of the Payload Timeliness Committee (PTC) handling to a lazy computation model is a notable performance improvement.
I've reviewed the changes and found a couple of potential issues. One is related to an incorrect optimization in the onboardBuildersFromPendingDeposits function that could lead to incorrect state during the Gloas fork upgrade. Another is a potential integer overflow bug in an optimized hashing function in seed.ts that could affect consensus in edge cases. My detailed comments are below.
| hashInput.writeUInt32LE(block, seed.length); | ||
| // Zero the upper 4 bytes for correct 8-byte little-endian encoding | ||
| hashInput.writeUInt32LE(0, seed.length + 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This optimization to write a 64-bit little-endian integer using writeUInt32LE is unsafe and can lead to incorrect behavior. The block variable, calculated as Math.floor(i / 16), can grow larger than 2**32 - 1 if the while loop runs for many iterations (e.g., in scenarios with very low effective balances). writeUInt32LE will truncate values larger than 32 bits, leading to an incorrect hash input and a potential consensus split.
You should use a method that safely handles 64-bit integers, such as Buffer.writeBigUInt64LE() or by using a DataView.
| hashInput.writeUInt32LE(block, seed.length); | |
| // Zero the upper 4 bytes for correct 8-byte little-endian encoding | |
| hashInput.writeUInt32LE(0, seed.length + 4); | |
| hashInput.writeBigUInt64LE(BigInt(block), seed.length); |
|
@codex review |
Performance Report✔️ no performance regression detected Full benchmark results
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28cf5d59e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
v1.7.0-alpha.2